home *** CD-ROM | disk | FTP | other *** search
- // MainView.h : interface of the CMainView class
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_MAINVIEW_H__51F9B1ED_CAEF_11D4_A5D3_444553540000__INCLUDED_)
- #define AFX_MAINVIEW_H__51F9B1ED_CAEF_11D4_A5D3_444553540000__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- class CRectItem;
-
- class CDot
- {
- public:
- CDot()
- {
- m_fX = m_fY = m_fZ = 0.;
- }
- double m_fX,
- m_fY,
- m_fZ;
- };
-
-
- class CMainView : public CScrollView
- {
- protected: // create from serialization only
- CMainView();
- DECLARE_DYNCREATE(CMainView)
- DWORD m_dwIdDots;
- // Attributes
- public:
- CMainDoc* GetDocument()
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMainDoc)));
- return (CMainDoc*) m_pDocument;
- }
-
- CRectItem* GetSelection() const
- { return m_pSelection; } // Just the top-most window
- // set bSafeSelect to TRUE when there is a chance that an inplace
- // active item could be deactivated before finishing
- void SetSelection(CRectItem* pNewSel, BOOL bSafeSelect = FALSE);
-
- LPDISPATCH GetIDispatch();
-
-
- // Operations
- public:
- void ClientToDoc(CRect &rc);
- void DocToClient(CRect &rc);
- void ClientToDoc(CPoint &pt);
- void DocToClient(CPoint &pt);
- void ClientToDoc(CSize &sz);
- void DocToClient(CSize &sz);
- void UpdateActiveItem();
- void ClearAll();
- void UnSelect() { m_pSelection = NULL; }
-
- void FindGraphsSet();
- void FindGraphsGet();
- void FindGraphsParams();
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainView)
- public:
- virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- protected:
- virtual void OnInitialUpdate(); // called first time after construct
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
- virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE);
- virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
- //}}AFX_VIRTUAL
-
- // Implementation
- protected:
- // m_pSelection holds the selection to the current CRectItem.
- // For many applications, such a member variable isn't adequate to
- // represent a selection, such as a multiple selection or a selection
- // of objects that are not CRectItem objects. This selection
- // mechanism is provided just to help you get started.
-
- BOOL m_bIsNet;
- CRectItem* m_pSelection;
- static CBrush NEAR m_brHatch;
- static CLIPFORMAT m_cfObjectDescriptor;
- BOOL m_bInDrag;
- COleDropTarget m_dropTarget;
- CPoint m_dragPoint;
- CSize m_dragSize;
- CSize m_dragOffset;
- DROPEFFECT m_prevDropEffect;
-
- CPoint m_pointMouse; // mouse click for paste
-
-
- CRectItem* GetHitItem(CPoint point);
- BOOL GetObjectInfo(COleDataObject* pDataObject, // for drag drop
- CSize* pSize, CSize* pOffset);
- void DoPasteNative(COleDataObject* pDataObject, CPoint* pPoint,
- CRectItem* pItem);
- void DoPasteStandard(BOOL bLink, COleDataObject* pDataObject,
- CPoint* pPoint, CRectItem* pItem, CLIPFORMAT cfFormat = 0);
- CRectItem* DoPasteItem (BOOL bLink, COleDataObject* pDataObject,
- CPoint* pPoint, CLIPFORMAT cfFormat = 0);
-
- void SelectionSetSize(CSize &size);
-
- public:
- virtual ~CMainView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-
- // drag drop implementation
- virtual BOOL OnDrop(COleDataObject* pDataObject,
- DROPEFFECT dropEffect, CPoint point);
- virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject,
- DWORD grfKeyState, CPoint point);
- virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject,
- DWORD grfKeyState, CPoint point);
- virtual void OnDragLeave();
-
- protected:
- // OLE Client support
- void SetupTracker(CRectTracker* pTracker, CRectItem* pItem, CRect* pTrueRect = NULL);
- void InvalidateItem(CRectItem* pItem);
- BOOL InsertObject(CLSID clsid, int x=0, int y=0);
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CMainView)
- afx_msg void OnDestroy();
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnInsertObject();
- afx_msg void OnCancelEditCntr();
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnEditClear();
- afx_msg void OnEditCopy();
- afx_msg void OnEditCut();
- afx_msg void OnPaste();
- afx_msg void OnObjectResetsize();
- afx_msg void OnUpdateEditMenu(CCmdUI* pCmdUI);
- afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
- afx_msg void OnUpdateEditClearAll(CCmdUI* pCmdUI);
- afx_msg void OnEditClearAll();
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnEditPasteInview();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnViewNet();
- afx_msg void OnUpdateViewNet(CCmdUI* pCmdUI);
- afx_msg void OnInsertFindGraph();
- afx_msg void OnItemDots();
- afx_msg void OnUpdateItemDots(CCmdUI* pCmdUI);
- afx_msg void OnItemDotsget();
- afx_msg void OnItemFindGraphProp();
- afx_msg void OnInsertExcel();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_MAINVIEW_H__51F9B1ED_CAEF_11D4_A5D3_444553540000__INCLUDED_)
-